//
//  FuncationListViewModel.swift
//  XingCeHelper
//
//  Created by 申铭 on 2023/2/3.
//

import Foundation

/// 功能
enum Function: String {
    case showIdiom = "展示内置成语"
    case importIdiomExplain = "导入自定义成语指南"
    case importIdiom = "导入内置成语"
    case importIdiomByCopy = "从粘贴板导入成语"
    
    case showShenLun = "展示内置申论"
    case importShenLunExplain = "导入申论指南"
    case importShenLunByXlsx = "导入内置申论"
    case importShenLun2ByXlsx = "导入内置申论问题对策"
}

class FuncationListViewModel {
    
    func loadDatas()  -> [BaseSectionModel] {
        var xcModels = [BaseCellModel]()
        var slModels = [BaseCellModel]()
        
        let showIdiomModel = SettingArrowAndExplainCellModel(title: Function.showIdiom.rawValue, detail: "点击右上角“保存”按钮可发送至微信。", tag: Function.showIdiom.rawValue)
        let importIdiomModel = SettingArrowAndExplainCellModel(title: Function.importIdiom.rawValue, detail: "导入内置成语至APP数据库，用于演示“背成语”功能，也可补充个人成语积累，可在“统计”->“成语”中删除导入的全部数据。", tag: Function.importIdiom.rawValue)
        let explainModel = SettingArrowAndExplainCellModel(title: Function.importIdiomExplain.rawValue, detail: "解释说明如何积累并导入自定义成语。", tag: Function.importIdiomExplain.rawValue)
        let importIdiomByCopyModel = SettingArrowAndExplainCellModel(title: Function.importIdiomByCopy.rawValue, detail: "通过复制粘贴的方式导入自定义成语，格式正确时，可同时导入多个成语。", tag: Function.importIdiomByCopy.rawValue)
        
        let showShenLunModel = SettingArrowAndExplainCellModel(title: Function.showShenLun.rawValue, detail: "点击右上角“保存”按钮可发送至微信。", tag: Function.showShenLun.rawValue)
        let importShenLunModel = SettingArrowAndExplainCellModel(title: Function.importShenLunByXlsx.rawValue, detail: "导入内置申论规范用词至APP数据库，用于演示“背规范词语”功能，可在“统计”->“规范词语”中删除导入的全部数据。", tag: Function.importShenLunByXlsx.rawValue)
        let importShenLunExplainModel = SettingArrowAndExplainCellModel(title: Function.importShenLunExplain.rawValue, detail: "解释说明申论规范用词模版格式以及如何导入自定义数据。", tag: Function.importShenLunExplain.rawValue)
        
        let importShenLun2ByXlsxModel = SettingArrowAndExplainCellModel(title: Function.importShenLun2ByXlsx.rawValue, detail: "", tag: Function.importShenLun2ByXlsx.rawValue)
        
        xcModels.append(showIdiomModel)
        xcModels.append(importIdiomModel)
        xcModels.append(explainModel)
        xcModels.append(importIdiomByCopyModel)
        
        slModels.append(showShenLunModel)
        slModels.append(importShenLunModel)
        slModels.append(importShenLunExplainModel)
        slModels.append(importShenLun2ByXlsxModel)
        
        var sections = [BaseSectionModel]()
        let section1 = BaseSectionModel(items: xcModels)
        let section2 = BaseSectionModel(items: slModels)
        sections.append(section1)
        sections.append(section2)
        
        return sections
    }
}
